home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Auge 4000
/
Auge 4000 #54 (1991-04-07)(Amiga User Gruppe Einzugsgebiet 4000).zip
/
Auge 4000 #54 (1991-04-07)(Amiga User Gruppe Einzugsgebiet 4000).adf
/
PopUpMenu
/
Source
/
PopUpMenu.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-07
|
3KB
|
120 lines
#define ABSEXECBASE ((struct ExecBase **)4L)
/* this is for lattice bug with 16-bit ints */
#undef RMBTRAP
#define RMBTRAP 0x00010000L
/* this is for missing limits */
#define WORD_MIN SHRT_MIN
#define WORD_MAX SHRT_MAX
#define UWORD_MIN USHRT_MIN
#define UWORD_MAX USHRT_MAX
/* this is for bug in AddSemaphore */
#undef AddSemaphore
#define AddSemaphore(SS) InitSemaphore(SS),\
Enqueue(&((*ABSEXECBASE)->SemaphoreList),\
&((SS)->ss_Link))
/* this is a fake intuimessage-class used to quit the popupmenu program */
#define QUITPOPUPMENU 0
#define HIGHLIGHTON 0
#define HIGHLIGHTOFF 1
#define BORDERSIZE 2
#define OVERLAP 7
#define AND &&
#define OR ||
#define ITEMWINDOW 0
#define SUBWINDOW SHRT_MAX
/* used for drawing commandkeys */
#define LORESSCREEN TRUE
#define HIRESSCREEN FALSE
/* used by DrawMenuItem */
#define SELECTFILL 1
#define ITEMFILL 0
#define VERIFYOK 0x0001
#define QUIT 0x0002
struct WindowSize {
WORD Left, Top, Right, Bottom;
};
struct WindowData {
BOOL BitMapOk;
BOOL ItemsEnabled;
WORD LeftEdge, TopEdge;
WORD RightEdge, Bottom;
WORD Width, Height;
WORD TopValue, LeftValue;
struct MenuItem *Items;
struct BitMap Bm;
};
struct SignalData {
struct Task *PopUpMenuTask;
LONGBITS MenuUpSig;
LONGBITS MenuDownSig;
LONGBITS MouseMovedSig;
LONGBITS SelectDownSig;
BOOL Down;
};
struct MenuSort {
struct MenuSort *Next;
struct Menu *MenuPtr;
};
/* My functioms */
VOID InitPopUpMenu(VOID);
VOID WriteAndClose(STRPTR,ULONG);
VOID PopUpMainLoop(struct SignalData *);
struct MsgPort *MyCreatePort(STRPTR);
VOID MyDeletePort(struct MsgPort *);
VOID PopUpMenu(struct SignalData *);
VOID QueTimer(VOID);
VOID InitGlobals(VOID);
BOOL OpenMenuWindow(WORD);
VOID DrawAllMenues(VOID);
VOID HighLightItem(struct MenuItem *, struct WindowData *, UWORD);
VOID HighLightCurrItemBehind(UWORD);
struct MenuItem *FindMouseItem(struct WindowData *);
VOID SelectItem(VOID);
VOID OpenItemWindow(struct WindowData *, struct WindowData *, WORD, UWORD);
VOID CheckItemSize(struct MenuItem *, APTR);
VOID CloseItemWindow(struct WindowData *);
VOID ToggleMenu(UWORD,struct Menu *);
VOID DrawAllItems(struct WindowData *);
VOID DrawMenuItem(struct MenuItem *, struct WindowData *, UWORD);
struct Menu *FindMenuPtr(UWORD);
WORDBITS FinalSelect(VOID);
VOID CheckMark(struct MenuItem *, struct MenuItem *);
UWORD FindItemNr(struct MenuItem *, struct MenuItem *);
VOID TellWindow(WORDBITS);
BOOL BuildBitMap(struct WindowData *);
VOID ClearWindow(struct WindowData *);
VOID RemoveBitMap(struct WindowData *);
BOOL MouseInWindow(struct WindowData *);
WORD SendMessage(VOID);
struct IntuiMessage *BuildIntuiMsg(struct MsgPort *, ULONG, UWORD);
struct InputEvent *PopUpHandler(struct InputEvent *, struct SignalData *);
VOID MySetMenuStrip();
VOID MyClearMenuStrip();
VOID MyOnMenu();
VOID MyOffMenu();
ULONG Mystrlen(STRPTR);
VOID SwapBits(struct WindowData *);
BOOL FindWindow(VOID);
VOID FindItemWinSize(struct WindowData *, UWORD);
VOID PosItemWinLeft(struct WindowData *, struct WindowData *, UWORD);
VOID PosItemWinTop(struct WindowData *, WORD);
#define DeleteStdIO(IOReq) FreeMem((IOReq),sizeof(struct IOStdReq))